import time
from common_1.Ultils import ForumDriver
from selenium.webdriver.common.by import By

class ForumPersonalCenter:
    url = ""
    driver = ""
    def __init__(self):
        url="http://127.0.0.1:9580/#"
        self.driver = ForumDriver.driver
        self.driver.get(url)

    def ForumPersonalCenterTest(self):
        # 个人信息中心详情页面
        self.driver.find_element(By.CSS_SELECTOR,"#bit-forum-content > div.page-body > div > div > div > div.col.d-flex.flex-column > div")
        self.driver.find_element(By.CSS_SELECTOR,"#bit-forum-content > div.page-body > div > div > div > div.col-3.d-none.d-md-block.border-end > div")

        # 填写/修改昵称
        self.driver.find_element(By.CSS_SELECTOR,"#setting_input_nickname").clear()
        self.driver.find_element(By.CSS_SELECTOR,"#setting_input_nickname").click()
        self.driver.find_element(By.CSS_SELECTOR,"#setting_input_nickname").send_keys("Y47Z")
        time.sleep(3)

        # 填写/修改邮箱地址
        self.driver.find_element(By.CSS_SELECTOR,"#setting_input_email").clear()
        self.driver.find_element(By.CSS_SELECTOR,"#setting_input_email").click()
        self.driver.find_element(By.CSS_SELECTOR,"#setting_input_email").send_keys("Wljy785718491@qq.com")

        # 填写/修改电话号码
        self.driver.find_element(By.CSS_SELECTOR,"#setting_input_phoneNum").clear()
        self.driver.find_element(By.CSS_SELECTOR,"#setting_input_phoneNum").click()
        self.driver.find_element(By.CSS_SELECTOR,"#setting_input_phoneNum").send_keys("78571")

        self.driver.find_element(By.CSS_SELECTOR,"#settings_input_oldPassword").click()
        self.driver.find_element(By.CSS_SELECTOR,"#settings_input_oldPassword").send_keys("")

